#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <ctype.h>

struct mob {
	int pos_x;
	int pos_y;
	int dir_x;
	int dir_y;
};

void *
safe_alloc(const size_t s, const int k)
	/* s - size in bytes,
	 * k - multipliee */
{
	static size_t totmem = 0UL;
	void *ptr;

	ptr = calloc((size_t) k, s);

	if (ptr == NULL) {
		fprintf(stderr, "failed to allocate %lu bytes, bailing out\n"
				"total memory allocated %lu bytes\n",
				s * k, totmem);
		exit(EXIT_FAILURE);
	}

	totmem += s * k;

	return ptr;
}

void
dbg_print(const int8_t **t, const int n, const int m)
{
	int x, y;

	for (y = n - 1; y >= 0; y--) {
		for (x = 0; x < m; x++)
			fprintf(stderr, "%d", t[x][y]);
		fputc('\n', stderr);
	}
}

int
main(int argc, char **argv)
{
	int8_t **table;
	int n, m, k;
	char direction[2];
	struct mob *mobs;
	int i, x, y;
	int ans = 0;

	scanf("%d %d", &m, &n);

	table = safe_alloc(sizeof *table, m);
	for (i = 0; i < m; i++)
		table[i] = safe_alloc(sizeof **table, n);

	scanf("%d", &k);
	mobs = safe_alloc(sizeof *mobs, k);
	for (i = 0; i < k; i++) {
		scanf("%d %d %[NESW]", &mobs[i].pos_x, &mobs[i].pos_y,
				direction);
		mobs[i].dir_x = (direction[0] == 'N' || direction[0] == 'S') ?
			0 : ((direction[0] == 'E') ? 1 : -1);
		mobs[i].dir_y = (direction[0] == 'W' || direction[0] == 'E') ?
			0 : ((direction[0] == 'N') ? 1 : -1);

		mobs[i].pos_x--;
		mobs[i].pos_y--;
	}

	for (i = 0; i < k; i++) {
		x = mobs[i].pos_x;
		y = mobs[i].pos_y;
		table[x][i] |= 2;
		while (x >= 0 && x < m && y >= 0 && y < n) {
			if ((table[x][y] & 1) == 0) {
				table[x][y] |= 1;
				ans++;
			}
			x += mobs[i].dir_x;
			y += mobs[i].dir_y;
#ifdef DERPING_AROUND
			dbg_print(table, n, m);
			fputc('\n', stderr);
#endif
		}
	}

	printf("%d\n", ans);

	for (i = 0; i < n; i++)
		free(table[i]);
	free(table);
	free(mobs);

	return 0;
}
